/* 公示管理 */
<template>
  <div>
    <Row :gutter="16" v-if="chenge">
      <Col span="16">
      <Card :bordered="false">
        <p slot="title">
          <Row>
            <Col span="12">
              <p>公示管理</p>
            </Col>
            <Col span="12" style="text-align:right">
              开启公示审核<i-switch v-model="switch1" @on-change="change" />
            </Col>
          </Row>
        </p>
        <Row>
          <Col span="12" offset="12">
             <Input search enter-button placeholder="Enter something..." />
          </Col>
          <Col span="24">
            <Table border ref="selection" :columns="columns4" :data="data1"></Table>
             <div style="margin: 10px;overflow: hidden">
                <Row >
                    <Col span="12">
                        <Button type="error">删除</Button>
                    </Col>
                    <Col span="12" style="text-align:right">
                         <Page :total="100" :current="1" ></Page>
                    </Col>
                </Row>
            </div>
          </Col>
        </Row>
      </Card>
      <Card :bordered="false">
        <p slot="title">
          <Row>
            <Col span="12">
              <p>待审核</p>
            </Col>
          </Row>
        </p>
        <Row>
          <Col span="12" offset="12">
             <Input search enter-button placeholder="Enter something..." />
          </Col>
          <Col span="24">
            <Table border ref="selection" :columns="columns5" :data="data2"></Table>
             <div style="margin: 10px;overflow: hidden">
                <Row >
                    <Col span="12">
                        <Button type="error">删除</Button>
                    </Col>
                    <Col span="12" style="text-align:right">
                         <Page :total="100" :current="1" ></Page>
                    </Col>
                </Row>
            </div>
          </Col>
        </Row>
      </Card>
      </Col>
      <Col span="8">
      <Card :bordered="false">
        <p slot="title">
          待发布
        </p>
          <ul>
            <li>
              <p>某某某某办公</p>
              <p>张三  <Icon style="float:right" type="ios-trash" /></p>
            </li>
            <li>
              <p>某某某某办公</p>
              <p>张三  <Icon style="float:right" type="ios-trash" /></p>
            </li>
            <li>
              <p>某某某某办公</p>
              <p>张三  <Icon style="float:right" type="ios-trash" /></p>
            </li>
            <li>
              <p>某某某某办公</p>
              <p>张三  <Icon style="float:right" type="ios-trash" /></p>
            </li>
            <li>
              <p>某某某某办公</p>
              <p>张三  <Icon style="float:right" type="ios-trash" /></p>
            </li>
            <li>
              <p>某某某某办公</p>
              <p>张三  <Icon style="float:right" type="ios-trash" /></p>
            </li>
            <li>
              <p>某某某某办公</p>
              <p>张三  <Icon style="float:right" type="ios-trash" /></p>
            </li>
            <li>
              <p>某某某某办公</p>
              <p>张三  <Icon style="float:right" type="ios-trash" /></p>
            </li>
            <li>
              <p>某某某某办公</p>
              <p>张三  <Icon style="float:right" type="ios-trash" /></p>
            </li>
            <li>
              <p>某某某某办公</p>
              <p>张三  <Icon style="float:right" type="ios-trash" /></p>
            </li>
          </ul>
      </Card>
      </Col>
    </Row>
    <Row v-else>
      <Col span="24">
        <Card :bordered="false">
          <p slot="title">
            <Row>
              <Col span="12">
                <p>公示管理</p>
              </Col>
              <Col span="12" style="text-align:right">
                  <Button type="primary">通过</Button>
                  <Button type="warning">未通过</Button>
                  <Button type="error">删除</Button>
              </Col>
            </Row>
          </p>
          <div style="padding:60px 80px;height:600px">
            <h1>郑州某家具公司</h1>
            <p>所属行业</p>
          </div>
        </Card>
      </Col>
    </Row>
  </div>
</template>

<script>
export default {
  data() {
    return {
      switch1: true,
      chenge:false,
      columns4: [
        {
          type: "selection",
          width: 60,
          align: "center"
        },
        {
          title: "项目名称",
          key: "name"
        },
        {
          title: "姓名",
          key: "age"
        },
        {
          width: 100,
          title: "时间",
          key: "date"
        }
      ],
      data1: [
        {
          name: "John Brown",
          age: 18,
          address: "New York No. 1 Lake Park",
          date: "2016-10-03"
        },
        {
          name: "Jim Green",
          age: 24,
          address: "London No. 1 Lake Park",
          date: "2016-10-01"
        },
        {
          name: "Joe Black",
          age: 30,
          address: "Sydney No. 1 Lake Park",
          date: "2016-10-02"
        },
        {
          name: "Jon Snow",
          age: 26,
          address: "Ottawa No. 2 Lake Park",
          date: "2016-10-04"
        }
      ],
      columns5: [
        {
          type: "selection",
          width: 60,
          align: "center"
        },
        {
          title: "项目名称",
          key: "name"
        },
        {
          width: 100,
          title: "姓名",
          key: "age"
        },
        {
          width: 100,
          title: "时间",
          key: "date"
        },
        {
          title: "操作",
          key: "action",
          width: 150,
          align: "center",
          render: (h, params) => {
            return h("div", [
              h(
                "Button",
                {
                  props: {
                    type: "primary",
                    size: "small"
                  },
                  style: {
                    marginRight: "5px"
                  },
                  on: {
                    click: () => {
                      this.show(params.index);
                    }
                  }
                },
                "通过审核"
              )
            ]);
          }
        }
      ],
      data2: [
        {
          name: "John Brown",
          age: 18,
          address: "New York No. 1 Lake Park",
          date: "2016-10-03"
        },
        {
          name: "Jim Green",
          age: 24,
          address: "London No. 1 Lake Park",
          date: "2016-10-01"
        },
        {
          name: "Joe Black",
          age: 30,
          address: "Sydney No. 1 Lake Park",
          date: "2016-10-02"
        },
        {
          name: "Jon Snow",
          age: 26,
          address: "Ottawa No. 2 Lake Park",
          date: "2016-10-04"
        }
      ]
    };
  },

  methods: {
    topublicityContent() {
      this.$router.push("/publicityManagement/publicityContent");
    },
    change(status) {
      this.$Message.info("开关状态：" + status);
    }
  }
};
</script>

<style scoped>
.chenge{
  display: none
}
</style>
